﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Office = Microsoft.Office.Core;
using Microsoft.Office.Tools.Word;
using Microsoft.Office.Tools.Word.Extensions;
using Word = Microsoft.Office.Interop.Word;

namespace UCSD_BioLit
{
    class CustSmartTagAction : Microsoft.Office.Tools.Word.Action
    {
        

        public CustSmartTagAction()
            : base("")
        {

        }
        public CustSmartTagAction(string Caption, int TagID) : base(Caption)
        {
            m_TagID = TagID;
        }

        public void Init(int TagID)
        {
            m_TagID = TagID;
        }
        public int m_TagID;
    }
/*
    public class BioLitSmartTag : SmartTag
    {
        private Microsoft.Office.Tools.Word.Action Action1;
        public BioLitSmartTag()
            : base("http://mobile.sdsc.edu/BioLit#SmartTags", "BIOLIT TERM RECOGNIZER")
        {
            Action1 = new Microsoft.Office.Tools.Word.Action("Text change before display...");
            Action1.Click += new ActionClickEventHandler(Action1_Click);
            Actions = new Microsoft.Office.Tools.Word.Action[] { Action1 };
        }

        void Action1_Click(object sender, ActionEventArgs e)
        {
            
        }

        protected override void Recognize(string text, Microsoft.Office.Interop.SmartTag.ISmartTagRecognizerSite site, Microsoft.Office.Interop.SmartTag.ISmartTagTokenList tokenList)
        {
            string term = "rahulchandran";
            int index = this.ParagraphText.IndexOf(term, StringComparison.CurrentCultureIgnoreCase);

            while (index >= 0)
            {
                this.PersistTag(index, term.Length);
                index += term.Length;
                index = ParagraphText.IndexOf(term, index, StringComparison.CurrentCultureIgnoreCase);
            }
        }
    }
 * */
}
